package com.kaifamiao.variable;

public class Computer {
	
	private String name ;
	
	public Computer(String name) {
		super();
		this.name = name;
	}

	class Mainboard {
		
		private String name ;
		
		public Mainboard(String name) {
			super();
			this.name = name;
		}

		public void welcome( String name ) {
			System.out.println( name );
			System.out.println( this.name );
			// 通过 "外部类类名.this.实例变量名" 来访问外部类的实例变量
			System.out.println( Computer.this.name );
		}
	}
	
	public static void main(String[] args) {
		Computer.Mainboard m = new Computer( "小新" ).new Mainboard( "联想" );
		m.welcome( "小姜" );
	}

}
